package com.hitechbangla.fctu.form;

import fctu.simulator.HTB_MAIN;

/**
 *
 * @author Asus
 */


public class SelectACInfo extends javax.swing.JFrame {

    private HTB_MAIN htb_main;
    /**
     * Creates new form SelectACInfo
     */
    public SelectACInfo(HTB_MAIN htb_main) 
    {
	initComponents();
	this.htb_main = htb_main;
	
	if(htb_main.radarACInfoSelection.isCallSign())
	{
	    jCheckBoxCallSign.setSelected(true);
	}
	
	if(htb_main.radarACInfoSelection.isSpeed())
	{
	    jCheckBoxSpeed.setSelected(true);
	}
	
	if(htb_main.radarACInfoSelection.isHeading())
	{
	    jCheckBoxHeading.setSelected(true);
	}
	
	if(htb_main.radarACInfoSelection.isHeight())
	{
	    jCheckBoxHeight.setSelected(true);
	}
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jCheckBoxCallSign = new javax.swing.JCheckBox();
        jCheckBoxSpeed = new javax.swing.JCheckBox();
        jCheckBoxHeading = new javax.swing.JCheckBox();
        jCheckBoxHeight = new javax.swing.JCheckBox();
        jButtonOk = new javax.swing.JButton();

        jButton1.setText("jButton1");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setText("Select AC Info");

        jCheckBoxCallSign.setText("Call Sign");

        jCheckBoxSpeed.setText("Speed");

        jCheckBoxHeading.setText("Heading");

        jCheckBoxHeight.setText("Height");

        jButtonOk.setText("Ok");
        jButtonOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOkActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jCheckBoxHeight)
                    .addComponent(jCheckBoxSpeed)
                    .addComponent(jCheckBoxCallSign)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jButtonOk, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jCheckBoxHeading, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(60, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jCheckBoxCallSign)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCheckBoxSpeed)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCheckBoxHeading)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCheckBoxHeight)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                .addComponent(jButtonOk)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
        if(jCheckBoxCallSign.isSelected()==true)
	{
	    HTB_MAIN.radarACInfoSelection.setCallSign(true);
	}
	else
	{
	    HTB_MAIN.radarACInfoSelection.setCallSign(false);
	}
	
	if(jCheckBoxSpeed.isSelected()==true)
	{
	    HTB_MAIN.radarACInfoSelection.setSpeed(true);
	}
	else
	{
	    HTB_MAIN.radarACInfoSelection.setSpeed(false);
	}
	
	if(jCheckBoxHeading.isSelected()==true)
	{
	    HTB_MAIN.radarACInfoSelection.setHeading(true);
	}
	else
	{
	    HTB_MAIN.radarACInfoSelection.setHeading(false);
	}
	
	if(jCheckBoxHeight.isSelected()==true)
	{
	    HTB_MAIN.radarACInfoSelection.setHeight(true);
	}
	else
	{
	    HTB_MAIN.radarACInfoSelection.setHeight(false);
	}
	
	if(jCheckBoxCallSign.isSelected() || jCheckBoxCallSign.isSelected() || jCheckBoxCallSign.isSelected() || jCheckBoxCallSign.isSelected())
	{
	    HTB_MAIN.iFFOptionSelection.unSelectAll();
	}

	this.setVisible(false);
	this.dispose();
    }//GEN-LAST:event_jButtonOkActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
	/* Set the Nimbus look and feel */
	//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
	 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
	 */
	try {
	    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
		if ("Nimbus".equals(info.getName())) {
		    javax.swing.UIManager.setLookAndFeel(info.getClassName());
		    break;
		}
	    }
	} catch (ClassNotFoundException ex) {
	    java.util.logging.Logger.getLogger(SelectACInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (InstantiationException ex) {
	    java.util.logging.Logger.getLogger(SelectACInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (IllegalAccessException ex) {
	    java.util.logging.Logger.getLogger(SelectACInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	} catch (javax.swing.UnsupportedLookAndFeelException ex) {
	    java.util.logging.Logger.getLogger(SelectACInfo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
	}
	//</editor-fold>

	/* Create and display the form */
	java.awt.EventQueue.invokeLater(new Runnable() {
	    public void run() {
		//new SelectACInfo().setVisible(true);
	    }
	});
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButtonOk;
    private javax.swing.JCheckBox jCheckBoxCallSign;
    private javax.swing.JCheckBox jCheckBoxHeading;
    private javax.swing.JCheckBox jCheckBoxHeight;
    private javax.swing.JCheckBox jCheckBoxSpeed;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
